﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SyncList.Business.ValueObject;

namespace SyncList.Business.Persistence
{


    /// <summary>
    /// Singletong
    /// </summary>
    public class MemoryStorage
    {

        #region Singleton

        /// <summary>
        /// Unique instance
        /// </summary>
        private static MemoryStorage _instance = new MemoryStorage();

        /// <summary>
        /// Constructeur privé
        /// </summary>
        private MemoryStorage()
        {

        }

        /// <summary>
        /// Accès à la seule instance
        /// </summary>
        public static MemoryStorage Instance
        {
            get { return (_instance); }
        }
        
        #endregion

        #region Attributs

        private SyncListSettings _settings;

        #endregion

        #region Propriétés

        /// <summary>
        /// Définition des paramètres
        /// </summary>
        public SyncListSettings Settings
        {
            get { return (_settings); }
            private set { _settings = value; }
        }

        #endregion

        #region Méthodes

        /// <summary>
        /// Initialiser
        /// </summary>
        public void Initialize()
        {
            Settings = Business.ServiceAccessor.RegistryService.Read(); // - Pas de settings passés en paramètre : lecture
           
        }


        #endregion


    }
}
